<?php $this->headScript()->appendFile($this->JS_PATH . 'uom.js'); ?>
<div id="uom"></div>
<div id="MainContent">
    <div>
        <div class="pageerrorcontainer-validator">
            <div class="error-iterator"></div>
        </div>
    </div>
    
    <?php if ($this->succesMessage != ""): ?>
    <div class='pagemcontainer'>
        <p class='pagemessage'>
            <img src="<?php echo $this->IMAGE_PATH;?>icons/system/accept.gif" class="systemicon" alt="Success" title="Success" />
            <label class='errorlabel'><?php echo $this->succesMessage; ?></label>
        </p>
    </div>
    <?php endif; ?>			
    
    <?php if (count($this->errorMessageArray) > 0): ?>
        <div class="pageerrorcontainer">
            <?php foreach ($this->errorMessageArray as $erroValue): ?>
                <div class="pageoverflow">
                    <img src="<?php echo $this->IMAGE_PATH;?>icons/system/stop.gif" class="systemicon" alt="Error" title="Error" />
                    <label class="errorlabel"><?php echo $erroValue; ?></label>
                </div>
            <?php endforeach; ?>				
        </div>
    <?php endif; ?>
    
    <div class="unit-delete-container pageerrorcontainer display-none">
        <div class="pageoverflow">
            <img src="<?php echo $this->IMAGE_PATH;?>icons/system/stop.gif" class="systemicon" alt="Error" title="Error" />
            <label class="errorlabel">This unit cannot be deleted unless removed from all existing jobs and products.</label>
        </div>
    </div>

    <div class="clearb">&nbsp;</div>
    <div id="preference"></div>
    <div class="pagecontainer pageoverflow">
        <div class="pageheader">
            Add Unit of measurement
            <div class="field-required">* Fields are required </div>
        </div>
        <div style="clear: both;"></div>
        <form id="uom-form" name="uom-form"  enctype="multipart/form-data"  action="" method="post">
            <div id="page_content">
                <div class="pageoverflow upload-unit-container">	
                    <p class="pagetext">Unit of measurement :</p>
                    <p class="pageinput">
                        <input type="text" size="40" value="<?php echo $this->uom; ?>" id="title" name="uom">
                    </p>
                </div>
                
                <div class="pageoverflow">
                    <p class="pagetext">&nbsp;</p>
                    <p class="pageinput">
                        <input type="submit" title="Save changes" value="Add Unit" name="submitbutton">
                        <input type="reset" title="Save changes and continue to edit" value="Reset" name="apply">
                    </p>
                </div>
                
                <div style="clear: both;"></div>
                
                <?php if(count($this->uomArray) > 0):?>
                <?php foreach($this->uomArray as $_uom):?>
                    <div class="pageoverflow upload-unit-container">	
                    <p class="pagetext">Unit of measurement :</p>
                    <p class="pageinput">
                        <input type="text" size="40" readonly value="<?php echo $_uom['uom_value']; ?>" id="title">
                        <input type="button" id="<?php echo $_uom['uom_id']; ?>" name="Remove Unit" value="Remove Unit" class="remove_unit"/>
                    </p>
                    </div>
                <?php endforeach;?>
                <?php endif;?>
                
            </div>
        </form>
    </div>
    <p class="pageback">
        <a class="pageback" href="<?php echo $this->url(array('controller' => 'index', 'action' => 'index'), null, TRUE) ?>">&#171; Back to Listing</a>
    </p>
    <div class="clearb"></div>
</div>